<template>
  <div class="body">
    <!-- <img :src="'http://192.168.0.28:8082/'+zhuurl" alt="" srcset=""> -->
    <ul class="top">
      <li>
        <p>待分配保函</p>
        <h1>{{homepagelist.daishen_number}}</h1>
        <img src="../../assets/li.png" alt />
      </li>
      <li>
        <p>待审核保函</p>
        <h1>{{homepagelist.daishen_number}}</h1>
        <img src="../../assets/li.png" alt />
      </li>
      <li>
        <p>待支付保函</p>
        <h1>{{homepagelist.daishen_number}}</h1>
        <img src="../../assets/li.png" alt />
      </li>
      <li>
        <p>待开发票保函</p>
        <h1>{{homepagelist.fapiao}}</h1>
        <img src="../../assets/li.png" alt />
      </li>
    </ul>
    <div class="center">
      <div class="left">
        <ul class="center-left">
          <li>
            <h1 style="color: #333; font-size: 20px">待办事项</h1>
            <p>查看更多 ></p>
          </li>
          <li>
            <h3 class="title">
              南阳市口腔医院新院区10配电工程第1标段
              <button class="btn1">投标保函</button>
            </h3>
            <p>申请编号：DS458198458SAD451498</p>
            <p>保证金金额：10000</p>
            <p>开标时间：2022-08-18 09:00:00</p>
            <button class="btn">去审核</button>
          </li>
          <li>
            <h3 class="title">
              南阳市口腔医院新院区10配电工程第1标段
              <button class="btn1">投标保函</button>
            </h3>
            <p>申请编号：DS458198458SAD451498</p>
            <p>保证金金额：10000</p>
            <p>开标时间：2022-08-18 09:00:00</p>
            <button class="btn">去审核</button>
          </li>
        </ul>
      </div>
      <table class="right">
        <h1 class="notice">通知</h1>
        <tr>
          <img src="../../assets/avatar.png" alt />
          <p>官方</p>
          <p>在 蜂鸟小分队 新建项目 6月迭代</p>
          <p>5个小时</p>
        </tr>
        <tr>
          <img src="../../assets/avatar.png" alt />
          <p>官方</p>
          <p>在 蜂鸟小分队 新建项目 6月迭代</p>
          <p>5个小时</p>
        </tr>
        <tr>
          <img src="../../assets/avatar.png" alt />
          <p>官方</p>
          <p>在 蜂鸟小分队 新建项目 6月迭代</p>
          <p>5个小时</p>
        </tr>
        <tr>
          <img src="../../assets/avatar.png" alt />
          <p>官方</p>
          <p>在 蜂鸟小分队 新建项目 6月迭代</p>
          <p>5个小时</p>
        </tr>
      </table>
    </div>
    <div class="bottom">
      <p>
        新进保函数据
        <small>(近七天)</small>
      </p>
      <div id="main"></div>
    </div>
  </div>
</template>

<script>
import axios from "axios";
import { homepage } from "@/api/homepage";
export default {
  data() {
    return {
      homepagelist: [],
      date: [],
      params: {},
      riqi: [],
      shuliang: [],
      zhuurl:"",
    };
  },
  beforeCreate() {
    // var user_id = sessionStorage.getItem("user_id");
    // let token = sessionStorage.getItem('token')
    homepage().then(response => {
      if (response.data.code == 1) {
        this.homepagelist = response.data;
        var bbc = response.data.data.project_number;
        for (let index = 0; index < 7; index++) {
          this.riqi.push(bbc[index].day);
          this.shuliang.push(bbc[index].number); 
      
        }
          this.riqi.reverse()
          this.shuliang.reverse()
        this.drawChart();
      }else{
        this.$message.error(response.data.msg)
      }
    });
  },
created(){
this.zhufu()
		},
  methods: {
    //页面
   			zhufu(){
   axios({
        url: "http://192.168.0.28:8082/api/pay/paysend",
        method: "post", // params: '必须是一个无格式对象 query参数',
        data: {
        //  ...cion
        },
        timeout: 1000,
        headers: {
          token: sessionStorage.getItem("token")
        }
      }).then(res => {
        
		console.log("支付",res.data.data.url)
         if (res.data.code == 1) {
       this.zhuurl=res.data.data.url
        } else {
          this.$message.error(res.data.mag);
        }
        // this.$router.push("/BidSecurity/Bidpayment");
      })
          .catch((err) => {
        console.log("失败",err.response.data);
          this.$notify.error({
          message: err.response.data.msg
        });
      });
			},

    drawChart() {
      let myEchart = this.$echarts.init(document.getElementById("main"));
      let option = {
        xAxis: {
          data: this.riqi
        },
        yAxis: {},
        series: [
          {
            data: this.shuliang,
            type: "line",
            smooth: true,
            symbol: "none",
            areaStyle: {
              color: "#344CE9",
              opacity: 0.5
            }
          }
        ]
      };
      myEchart.setOption(option);
    }
  },
  mounted() {
    this.drawChart();
  }
};
</script>

<style scoped>
ul li {
  list-style: none;
}

.body {
  position: absolute;
  width: 88vw;
  height: 91vh;
}

.top {
  width: 86vw;
  height: 15vh;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-top: -10px;
}

.top li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  overflow: hidden;
  color: #fff;
}

.top li p {
  margin: 30px;
}

.top li h1 {
  font-size: 40px;
  margin-top: 60px;
  margin-left: -280px;
}

.top li img {
  margin-top: 30px;
  /* margin-left: 290px; */
}

.top li:nth-of-type(1) {
  width: 21.3vw;
  height: 15vh;
  background: url(../../assets/li1.png);
  background-repeat: no-repeat;
  background-size: 100% 99%;
  margin-left: -40px;
}

.top li:nth-of-type(2) {
  width: 21.3vw;
  height: 15vh;
  background-image: url(../../assets/li2.png);
  background-repeat: no-repeat;
  background-size: 100% 99%;
}

.top li:nth-of-type(3) {
  width: 21.3vw;
  height: 15vh;
  background-image: url(../../assets/li3.png);
  background-repeat: no-repeat;
  background-size: 100% 99%;
}

.top li:nth-of-type(4) {
  width: 21.3vw;
  height: 15vh;
  background-image: url(../../assets/li4.png);
  background-repeat: no-repeat;
  background-size: 100% 99%;
}

.center {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  width: 88vw;
  height: 37vh;
}

.center .left {
  width: 43.5vw;
  height: 37vh;
}

.center-left {
  color: #666666;
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  justify-content: space-between;
}

.center-left title {
  color: #333;
  font-size: 16px;
}

.center-left .btn1 {
  color: #fff;
  width: 97px;
  height: 28px;
  border: none;
  background-color: #1795ff;
  margin-left: 10px;
}

.center-left .btn {
  position: absolute;
  left: 700px;
  color: #fff;
  margin-top: -100px;
  width: 120px;
  height: 40px;
  border: none;
  background-color: #1795ff;
}

.center-left li:nth-of-type(1) {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  width: 40vw;
  height: 7vh;
  margin-top: -10px;
}

.center-left li:nth-of-type(2) {
  width: 40vw;
  height: 15vh;
  margin-top: -20px;
}

.center .right {
  display: flex;
  flex-direction: column;
  width: 43.5vw;
  height: 37vh;
}

.center .right .notice {
  margin: 20px;
}

.center .right tr {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  width: 41vw;
  height: 5vh;
  margin-bottom: 2vh;
  margin-left: 30px;
  background-color: #f8f9fb;
  align-items: center;
}

.center .right tr p:nth-of-type(2) {
  color: #282d30;
}

.center .right tr p:nth-of-type(2) {
  font-size: 12px;
  color: #74798c;
}

.center .right tr p:nth-of-type(3) {
  font-size: 10px;
  color: #9ba2ab;
}

.center .right tr img {
  width: 25px;
  height: 25px;
  margin: 15px;
}

.bottom {
  width: 88vw;
  height: 39vh;
  margin-top: -100px;
}

.bottom p {
  margin-top: 110px;
  margin-left: 40px;
}

#main {
  margin-top: -40px;
  width: 88vw;
  height: 39vh;
}
</style>
